<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三维菜单</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
            box-sizing: border-box;
        }
        :root{
            font-size: 20px;
        }
        body{
            background: #123;
            min-height: 100vh;
        }
        ul{
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%) skewY(-15deg);
            counter-reset: counter;
        }
        li{
            position: relative;
            width: 20rem;
            height: 3rem;
            font-size: 1.5rem;
            line-height: 3rem;
            text-align: center;
            background: #789;
            z-index: calc(999 - var(--n));
            transition: .5s;
        }
        li:hover{
            transform: translateX(-50px);
            background: #4f5fa1;
        }
        li:hover::before{
            background: #2c346c;
        }
        li::before{
            content: "";
            width: 2rem;
            height: 3rem;
            background: #345;
            position: absolute;
            left: -2rem;
            top: -1rem;
            transform: skewY(45deg);
            transition: .5s;
        }
        li::after{
            content: "";
            width: 20rem;
            height: 2rem;
            background: #567;
            position: absolute;
            left: -1rem;
            top: -2rem;
            transform: skewX(45deg);
        }
    </style>
</head>
<body>
    <ul>
        <li style="--n:1">菜单1</li>
        <li style="--n:2">菜单2</li>
        <li style="--n:3">菜单3</li>
        <li style="--n:4">菜单4</li>
        <li style="--n:5">菜单5</li>
        <li style="--n:6">菜单6</li>
    </ul>
</body>
</html>